import ajax from '@/utils/request'
import { concatUrl } from '@/utils'
import './types'

export function getGoodsDetails(data: getGoodsDetails, fields: string | object = { fields: '*,promotion.*' }) {
    return ajax({
        url: concatUrl('/v1/goods/goods/view', fields),
        data
    })
}

export function getPlatformGoodsDetails(data: getGoodsDetails, fields: string | object = { fields: '*,promotion.*,canBuy,activityStatus' }) {
	return ajax({
			url: concatUrl('/v1/goods/goods/platform-view', fields),
			data
	})
}

// 集划算 判断某个门店是否可下单
export function getJihuasuanStoreCanOrder(data, fields: string | object = { fields: 'can,storeCode' }) {
	return ajax({
			url: concatUrl('/v2/store/get-store-can-order', fields),
			data
	})
}
